package com.cdcas;

public class AccoutTest {
    public static void main(String[] args) {
        Account account = new Account("test1",100);
        int money[] = new int[]{110,200,1000};
        for (int x=0;x<10;x++) {
            if (x%2==0) {
                new Thread(()->{
                    for (int y=0;y<money.length;y++) {
                        account.save(money[y]);
                    }
                },"存款者-" + x).start();
            } else {
                new Thread(()->{
                    while (true) {
                        System.out.println(account);
                    }
                },"查询者-"+x).start();
            }
        }
    }
}
